<?php

class tplOneFollower extends StudyBuddy\Template\Template
{

	protected static function func(&$a){

		if(!empty($a['avatar'])){
			$a['avatar'] = STUDYBUDDY_AVATAR_IMG_SITE.'/w/img/avatar/sqr/'.$a['avatar'];
		} elseif (!empty($a['avatar_external'])){
			$a['avatar'] = $a['avatar_external'];
		} elseif (!empty($a['gravatar']) && !empty($a['email'])){
			$a['avatar'] = $a['gravatar']['url'].hash('md5', $a['email']).'?s=36'.'&d='.$a['gravatar']['fallback'].'&r='.$a['gravatar']['rating'];
		} else {
			$a['avatar'] = STUDYBUDDY_IMAGE_SITE.'/images/avatar.png';
		}

		$fn = (!empty($a['fn'])) ? $a['fn'] : '';
		$ln = (!empty($a['ln'])) ? $a['ln'] : '';
		$mn = (!empty($a['mn'])) ? $a['mn'] : '';

		$displayName = $fn.' '.$mn. ' '.$ln;
		$a['displayName'] = (strlen($displayName) > 2) ? $displayName : $a['username'];
	}

	protected static $vars = array(
	'_id' => '', //1
	'displayName' => '', //2
	'i_rep' => '',  //3
	'avatar' => '', //4
	'username' => '', //5
	'since' => '', //6
	'follow_type' => 'flwr' // 7
	);


	protected static $tpl = '
	<div class="fl f2" id="%7$s_%1$s">
		<a href="/users/%1s/%5$s" class="ttt" title="%2$s **%3$s**"><span class="avtr_bg imgloader" style=\'background-image:url("%4$s");\'>&nbsp;</span></a>
	</div>';

}
